using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class webadmin_reports_danhsachNTD : System.Web.UI.Page
{
    public static rptDataSet ds = new rptDataSet();
    Common comm = new Common();
    protected void Page_Load(object sender, EventArgs e)
    {
        CrystalDecisions.CrystalReports.Engine.ReportDocument myReport = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
        myReport.Load(Server.MapPath("rpt_danhsachNTD.rpt"));
        //myReport.Load(Server.MapPath("baocao05_doanhnghiep.rpt"));



        DataTable dtt = comm.getDataTable("SELECT DoanhNghiep_doanh_nghiep.ma_doanh_nghiep, DoanhNghiep_doanh_nghiep.tai_khoan, DoanhNghiep_doanh_nghiep.ten_doanh_nghiep,DoanhNghiep_doanh_nghiep.ten_tat, DanhMuc_so_huu.ten_so_huu, dbo.fcGetDiaChiChiTiet(DoanhNghiep_doanh_nghiep.ma_dia_chi) AS dia_chi, dbo.fcGetThanhPho(DoanhNghiep_doanh_nghiep.ma_dia_chi) AS thanh_pho, DoanhNghiep_doanh_nghiep.dia_chi_chi_tiet," +
                      "   DoanhNghiep_doanh_nghiep.nguoi_lien_he, DoanhNghiep_doanh_nghiep.chuc_vu, DoanhNghiep_doanh_nghiep.dien_thoai, DoanhNghiep_doanh_nghiep.fax,DoanhNghiep_doanh_nghiep.email, DoanhNghiep_doanh_nghiep.ma_so_thue FROM DoanhNghiep_doanh_nghiep INNER JOIN DanhMuc_so_huu ON DanhMuc_so_huu.ma_so_huu = DoanhNghiep_doanh_nghiep.ma_so_huu");



        //ds.DoanhNghiep.Merge(dtt);

        myReport.SetDataSource(dtt);

        CrystalReportViewer1.ReportSource = myReport;
    } 
}
